/*
 * @Author: MuQuanyu(MQy)
 * @Date: 2025-10-11 13:03:58
 * @LastEditTime: 2025-10-14 09:27:21
 * @email: muquanyu@outlook.com
 */
import { http } from "@/utils/http";
import type { SysEditOrg, SysOrg, SysOrgPageParams, SysOrgRes } from "./types";
import type { IdsParams, PageParams } from "@/api/types";
// 获取组织树列表
export function GetOrgTreeList() {
  return http.get<SysOrgRes>("/api/sys-org/tree-list", {}, {});
}
// 获取组织分页扁平化
export function GetOrgFlatPage(pageParams: SysOrgPageParams) {
  return http.get<SysOrg>("/api/sys-org/page", pageParams, {});
}
// 添加组织
export function AddOrg(sysOrg: SysOrg) {
  return http.post<string>("/api/sys-org/add", sysOrg, {});
}

// 添加组织
export function EditOrg(sysEditOrg: SysEditOrg) {
  return http.post<string>("/api/sys-org/edit", sysEditOrg, {});
}

// 删除组织
export function DeleteOrg(idsParams: IdsParams) {
  return http.post<string>("/api/sys-org/delete", idsParams, {});
}

// 查询组织详情
export function OrgDetail(id: string) {
  return http.get<any>("/api/sys-org/detail", { id }, {});
}
